package com.itheima.charest;

import java.io.*;

public class CharStreamDemo08 {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr=new InputStreamReader(new FileInputStream("C:\\Users\\ASUS\\Desktop\\a.txt"),"utf-8");
        int len;
        while ((len=isr.read())!=-1){
            System.out.println((char)len);
        }
        isr.close();
        OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("C:\\Users\\ASUS\\Desktop\\a.txt"),"utf-8");
        osw.write("迪丽热巴");
        osw.close();

    }
}
